/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2025-02-10 14:57:51
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2025-02-10 15:58:39
 * @FilePath: \csgz_code\include\io_test.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef IO_TEST_H
#define IO_TEST_H

#define IO_COUNT 64
#define CIBAOCHI_COUNT 4

#define GPIO_START 788
#define GPIO_END 1023



#define EMIO_START 832
#define EMIO_END 863

#define SYS_GPIO_PATH "/sys/class/gpio"

// 静默模式开关 (1:启用静默 0:显示信息)
#define SILENT_MODE 1

// IO 测试函数声明
void test_all_io( int cmd_fd ); // 测试所有 IO 引脚
void test_0_47_io_devices(int cmd_fd);  
void test_48_io_devices(int cmd_fd);  
void test_49_56_4CBC_devices( int cmd_fd );
void test_57_io_devices( int cmd_fd );
void test_58_59_io_devices( int cmd_fd );
void test_60_63_io_devices( int cmd_fd );

void set_gpio_all_reset(int cmd_fd, __u_char* sendbuf);
void set_gpio_all_set(int cmd_fd, __u_char* sendbuf);
void test_gpio(int cmd_fd, __u_char* sendbuf);
void check_input_gpio_state( unsigned char* data, int choice );
void handle_choice_io(int choice, int cmd_fd, char* sendbuf );
#endif // IO_TEST_H
